-- $Name: graph_bunker$
-- $Version: 0.0.0$
-- $Author: Lebedev Anton$
instead_version "1.6.1";

require "timer"
require "sprites"
require "theme"
require "click"

dofile ('graph/graph.lua')

click.bg = true
click.press = true
click.button = true

function init()
	bg = graph.object {spr = 'background.png'}
	box = graph.object {spr = 'box.png'}
	panel = graph.object {spr = 'panel.png', frame = {fw = 100}}
	r_lamp = graph.object {spr = 'r_lamp.png', frame = {fw = 15}}
end

function start()
	timer:set(100)
end

game.timer = function (t)
	r_lamp.frame.shift(15, 0, true)
	r_lamp.render()
	
	sprite.draw (bg.get_sprite(), sprite.screen(), 0, 0)
	sprite.draw (box.get_sprite(), sprite.screen(), 0, 0)
	sprite.draw (panel.get_sprite(), sprite.screen(), 200, 150)
	sprite.draw (r_lamp.get_sprite(), sprite.screen(), 210, 210)
end

game.click = function (c, press, button, x, y)
	if press then
		panel.frame.shift(100, 0, true)
		panel.render()
	end
end
